/* ===========================================================================
   1. General styles
   ========================================================================== 
   This file contains the general styles for the application, including layout,
   buttons, inputs, loading indicators, markers, and API status.
*/
body {
  display: flex;
  flex-direction: row;
  font-family: Arial, sans-serif;
  background: linear-gradient(to bottom, #666666, #363636);
}

.container {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.viewport {
  width: 100%;
  height: 60vh;
  overflow: hidden;
  background-color: #cdcdcd;
}

/* main content styles */
.main-content {
  flex-direction: column;
  flex: 2;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* sidebar styles */
.sidebar {
  flex-direction: column;
  flex: 1;
  color: #fff;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

/* ==========================================================================
    2. Button styles
   ========================================================================== */
button {
  background-color: #4caf50; /* Green */
  border: none;
  color: white;
  padding: 5px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  width: 100%;
}

button:hover {
  background-color: #45a049; /* Darker green */
}

.delete-btn {
  float: right;
  max-width: 60px;
  margin-top: auto;
  background-color: #f77970;
  color: white;
  border: none;
  border-radius: 3;
  padding: 2px;
  cursor: pointer;
}

.delete-btn:hover {
  background-color: #f44336;
}
/* ==========================================================================
   3. Input styles
   ========================================================================== */
textarea {
  width: 100%;
  height: 10%;
  padding: 10px;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 14px;
  border: none;
  background-color: #f0f0f0;
}

.fold {
  background: rgba(255, 255, 255, 0.9);
  color: #363636;
  padding: 5px;
  border-radius: 5px;
  box-shadow: #363636 0px 0px 10px;
}

/* ==========================================================================
   4. loading styles
   ========================================================================== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.progress-text {
  font-size: 14px;
  color: #dbdbdb;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   5. controls Styles
   ========================================================================== */
.controls {
  display: flex;
  flex-direction: row;

  gap: 10px;
  margin-bottom: 20px;
  margin-top: 10px;
}
/* Slider Styles */
input[type="range"] {
  width: 150px;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  margin: 0 10px;
}

input[type="range"]:focus {
  background: #b3e5fc;
}

input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: #388e3c;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

input[type="range"]:hover::-moz-range-thumb {
  background: #388e3c;
}

input[type="range"]::-ms-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

input[type="range"]:focus::-ms-fill-lower {
  background: #b3e5fc;
}

input[type="range"]:focus::-ms-fill-upper {
  background: #b3e5fc;
}

input[type="range"]::-ms-fill-lower,
input[type="range"]::-ms-fill-upper {
  background: #ddd;
}

input[type="range"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Checkbox Styles */
input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #4caf50;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin-right: 8px;
}

input[type="checkbox"]:checked {
  background: #4caf50;
  border-color: #388e3c;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}




/* ==========================================================================
   6. Marker Styles
   ========================================================================== */

.custom-marker {
  position: relative;
  width: 15px;
  height: 15px;
}

.marker-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-img {
  width: 100%;
  height: 100%;
}

.marker-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  color: white;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
}

.marker-selected {
  filter: hue-rotate(120deg);
  transform: scale(1.2);
  transition: all 0.2s ease-in-out;
}

/* ==========================================================================
   8. API Status
   ========================================================================== */

.api-status {
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  margin: 10px 0;
}

#map .api-status {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
}

#rate-limit,
#rate-reset {
  display: block;
  white-space: nowrap;
}

#map {
  flex: 1;
  max-height: 80vh;
  border-radius: 10px;
}

/* ==========================================================================
   5. Marker Styles
   ========================================================================== */

.marker.selected {
  background-color: #007bff;
  color: white;
  border-radius: 30px;
  transform: scale(1.2); /* Make the marker slightly larger when selected */
  transition: transform 0.2s ease-in-out;
  z-index: 1000 !important; /* Ensure selected marker appears above others */
}
/* ==========================================================================
   7. List Styles
   ========================================================================== */
#selected-addresses {
  align-items: center;
}

#sortable-list {
  border: 1px solid #ccc;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#sortable-list li {
  cursor: move;
  padding: 10px;
  border: 4px solid #ccc;
  margin-bottom: 5px;
}

.selected {
  background-color: #007bff;
  color: white;
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 10px 0;
  background: #363636;
  border-radius: 2px;
  overflow-y:scroll;
  max-height: fit-content;
}

li {
  padding: 10px;
  border-bottom: 1px solid #363636;
}
